package com.wangtongxiao.mapper;

import java.io.File;

public class MyIo2 {
//文件夹遍历
    public void Wen(File file){
        System.out.println(file.getAbsolutePath());

        if (file.isDirectory()){
           File[] files = file.listFiles();

         for (File file1 : files) {
               System.out.println(file1.getAbsolutePath());
               Wen(file1);

            }
            }



    }

    public static void main(String[] args) {
        MyIo2 myIo2 = new MyIo2();

        String path = "d:\\作业";
        File file = new File(path);

        myIo2.Wen(file);
    }







}
